<?php

/**
 * EmpresaEgresosDetalles filter form base class.
 *
 * @package    cronos-doctrine
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseEmpresaEgresosDetallesFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'empresa_id'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Empresa'), 'add_empty' => true)),
      'empresa_egresos_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('EmpresaEgresos'), 'add_empty' => true)),
      'concepto_cf_id'     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('ConceptoCf'), 'add_empty' => true)),
      'division_id'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Division'), 'add_empty' => true)),
      'nomina_id'          => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Nomina'), 'add_empty' => true)),
      'camioneta_id'       => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Camioneta'), 'add_empty' => true)),
      'producto_id'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Producto'), 'add_empty' => true)),
      'categoria_id'       => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Categoria'), 'add_empty' => true)),
      'entidad_id'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Entidad'), 'add_empty' => true)),
      'is_impuesto'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'cantidad'           => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'presentacion'       => new sfWidgetFormFilterInput(),
      'precio_unitario'    => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'sub_total'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'created_at'         => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'updated_at'         => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
    ));

    $this->setValidators(array(
      'empresa_id'         => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Empresa'), 'column' => 'id')),
      'empresa_egresos_id' => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('EmpresaEgresos'), 'column' => 'id')),
      'concepto_cf_id'     => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('ConceptoCf'), 'column' => 'id')),
      'division_id'        => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Division'), 'column' => 'id')),
      'nomina_id'          => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Nomina'), 'column' => 'id')),
      'camioneta_id'       => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Camioneta'), 'column' => 'id')),
      'producto_id'        => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Producto'), 'column' => 'id')),
      'categoria_id'       => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Categoria'), 'column' => 'id')),
      'entidad_id'         => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Entidad'), 'column' => 'id')),
      'is_impuesto'        => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'cantidad'           => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'presentacion'       => new sfValidatorPass(array('required' => false)),
      'precio_unitario'    => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'sub_total'          => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'created_at'         => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'updated_at'         => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
    ));

    $this->widgetSchema->setNameFormat('empresa_egresos_detalles_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'EmpresaEgresosDetalles';
  }

  public function getFields()
  {
    return array(
      'id'                 => 'Number',
      'empresa_id'         => 'ForeignKey',
      'empresa_egresos_id' => 'ForeignKey',
      'concepto_cf_id'     => 'ForeignKey',
      'division_id'        => 'ForeignKey',
      'nomina_id'          => 'ForeignKey',
      'camioneta_id'       => 'ForeignKey',
      'producto_id'        => 'ForeignKey',
      'categoria_id'       => 'ForeignKey',
      'entidad_id'         => 'ForeignKey',
      'is_impuesto'        => 'Number',
      'cantidad'           => 'Number',
      'presentacion'       => 'Text',
      'precio_unitario'    => 'Number',
      'sub_total'          => 'Number',
      'created_at'         => 'Date',
      'updated_at'         => 'Date',
    );
  }
}
